package com.healthySys.backend.config;

import com.healthySys.common.utils.JWTStoreUtil;
import com.healthySys.common.utils.UserContextUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

@Configuration
@RequiredArgsConstructor
public class CommonConfig {

    private final StringRedisTemplate redisTemplate;

    @Bean
    public JWTStoreUtil jwtStoreUtil(){
        return new JWTStoreUtil(redisTemplate);
    }

    @Bean
    public UserContextUtil userContextUtil(){
        return new UserContextUtil(redisTemplate);
    }

}
